package com.cfzx.library.scene

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.webkit.WebView
import com.baymax.test.scene.BaseScene
import com.baymax.test.scene.demo.maverick.args

class BaseWebScene : BaseScene() {
    private val url: String by args<String>()
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup,
        savedInstanceState: Bundle?
    ): View = WebView(container.context)


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        println("load url :$url in $arguments")
        if (url.isNotBlank()) {
            (view as WebView).loadUrl(url)
        }
    }

}